home *** CD-ROM | disk | FTP | other *** search
/ Super PC 34 / Super PC 34 (Shareware).iso / spc / UTIL / DJGPP2 / V2 / DJTST200.ZIP / tests / libc / ansi / math / elefunt / tmacha.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-19  |  1.3 KB  |  56 lines

  1. /* -*-C-*- tsmach.c */
  2.  
  3. #include "elefunt.h"
  4.  
  5. static void dump(float x);
  6.  
  7. int
  8. main()
  9. {
  10.     int ibeta,
  11.         iexp,
  12.         irnd,
  13.         it,
  14.         machep,
  15.         maxexp,
  16.         minexp,
  17.         negep,
  18.         ngrd;
  19.     float
  20.         eps,
  21.         epsneg,
  22.     xmax,
  23.     xmin;
  24.     machar(&ibeta, &it, &irnd, &ngrd, &machep, &negep, &iexp, &minexp,
  25.     &maxexp, &eps, &epsneg, &xmin, &xmax);
  26.  
  27.     printf("ibeta............%d\n",ibeta);
  28.     printf("it...............%d\n",it);
  29.     printf("irnd.............%d\n",irnd);
  30.     printf("ngrd.............%d\n",ngrd);
  31.     printf("machep...........%d\n",machep);
  32.     printf("negep............%d\n",negep);
  33.     printf("iexp.............%d\n",iexp);
  34.     printf("minexp...........%d\n",minexp);
  35.     printf("maxexp...........%d\n",maxexp);
  36.     printf("eps.............." F15P5E "\n",eps);
  37.     dump(eps);
  38.     printf("epsneg..........." F15P5E "\n",epsneg);
  39.     dump(epsneg);
  40.     printf("xmin............." F15P5E "\n",xmin);
  41.     dump(xmin);
  42.     printf("xmax............." F15P5E "\n",xmax);
  43.     dump(xmax);
  44.     return (EXIT_SUCCESS);
  45. }
  46.  
  47. static void
  48. dump(float x)
  49. {
  50.     unsigned char *c = (unsigned char *)&x;
  51.     int s = sizeof(x), i;
  52.     for (i=0; i<s; i++)
  53.     printf("%02x,", (unsigned)c[i]);
  54.     printf("\n");
  55. }
  56.